package pwd.allen.construct.adapter;

import pwd.allen.construct.common.IConnection;
import pwd.allen.construct.common.OtherConnection;

/**
 * 对象适配器模式
 *
 * @author 门那粒沙
 * @create 2021-05-19 23:27
 **/
public class ObjectAdapter implements IConnection {

    private OtherConnection object;

    public ObjectAdapter(OtherConnection object) {
        this.object = object;
    }

    public void pingConnection(String host, int port, String dbName) {
        object.ping(String.format("other://%s:%s/%s", host, port, dbName));
    }
}
